package com.ywj.ehcache;

import java.util.Map;

import net.sf.ehcache.Element;
import net.sf.ehcache.search.attribute.AttributeExtractor;
import net.sf.ehcache.search.attribute.AttributeExtractorException;

/**
 * 查询缓存封装成MAP对象
 * @author ywj.you
 * @version 2018-6-29
 * @descripttion
 */
public class EhcacheAttrExtor implements AttributeExtractor {

	private static final long serialVersionUID = 1L;

	@SuppressWarnings("unchecked")
	public Object attributeFor(Element element, String attributeName) throws AttributeExtractorException {
		Map<String, Object> value = (Map<String, Object>) element.getValue();
		return value.get(attributeName);
	}

}
